Fix check for a working iptables installation. Checking for the iptables
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Mon, 14 Nov 2005 11:28:47 +0000 (12:28 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Mon, 14 Nov 2005 11:28:47 +0000 (12:28 +0100)
binary is not sufficient, because the user may not have the appropriate
modules installed.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/examples/vif-common.sh

index c571b8d95b2da6c67c26f869463d6b854270d782..fe3e6c67d1457c40b1b7bc2fedee526f4c6b13ba 100644 (file)
@@ -76,7 +76,11 @@ function frob_iptable()
 #
 function handle_iptable()
 {
-  if ! which iptables >&/dev/null
+  # Check for a working iptables installation.  Checking for the iptables
+  # binary is not sufficient, because the user may not have the appropriate
+  # modules installed.  If iptables is not working, then there's no need to do
+  # anything with it, so we can just return.
+  if ! iptables -L >&/dev/null
   then
     return
   fi